<style scoped>
	/*
	 * 上传图片
	 */
	
	.demo-upload-list {
		display: inline-block;
		width: 60px;
		height: 60px;
		text-align: center;
		line-height: 60px;
		border: 1px solid transparent;
		border-radius: 4px;
		overflow: hidden;
		background: #fff;
		position: relative;
		box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
		margin-right: 4px;
	}
	
	.demo-upload-list img {
		width: 100%;
		height: 100%;
	}
	
	.demo-upload-list-cover {
		display: none;
		position: absolute;
		top: 0;
		bottom: 0;
		left: 0;
		right: 0;
		background: rgba(0, 0, 0, .6);
	}
	
	.demo-upload-list:hover .demo-upload-list-cover {
		display: block;
	}
	
	.demo-upload-list-cover i {
		color: #fff;
		font-size: 20px;
		cursor: pointer;
		margin: 0 2px;
	}
	
	.user-context {
		padding: 15px;
	}
	
	.user-condition {
		width: 1800px;
	}
	
	.user-table {
		margin-top: 10px;
	}
	
	.user-dep {
		width: 259px;
		margin-left: 10px;
	}
	
	.second-row {
		margin-top: 10px;
	}
	
	.user-page {
		margin-top: 10px;
		float: right;
	}
	
	.btn-grop {
		margin-left: 25px;
		width: 200px;
		display: -webkit-inline-box;
	}
	
	.dep {
		margin-top: -25px;
	}
	
	.user-dep-span span {
		width: 90px;
		text-align: right;
		float: left;
		color: #495060;
		line-height: 1;
		padding: 10px 12px 10px 0;
		box-sizing: border-box;
	}
	
	.user-dep-style {
		margin-top: 10px;
	}
	
	.user-dep-style span {
		width: 90px;
		text-align: right;
		float: left;
		color: #495060;
		line-height: 1;
		padding: 10px 12px 10px 0;
		box-sizing: border-box;
	}
	
	.ivu-col-span-12 {
		height: 45px;
	}
	
	.user-pic {
		height: 88px;
		padding-left: 85px;
	}
	
	.user-dep-span .input {
		height: 33px;
	}
	
	.ivu-collapse-content {
		padding: 0;
	}
	
	.user-military-rank {
		width: 80% !important;
	}
	
	.user-military-rank .ivu-select-selection {
		margin-top: -10px;
	}
	
	.user-card-number {
		width: 77%;
	}
	
	.ivu-collapse-content {
		padding-right: 20px;
	}
	
	.other-info .ivu-form-item-label {
		width: 140px !important;
	}
	
	.other-info .ivu-select {
		width: 80%;
	}
	
	.job-check {
		width: 61% !important;
	}
	
	.job-check-add {
		margin-left: 24px;
		width: 96%;
		margin-bottom: -10px;
	}
	
	.other-info .ivu-form-item-required {
		margin-bottom: 0 !important;
	}
	
	.other-info-labal {
		margin-left: 36px !important;
	}
	
	.other-info .ivu-select[data-v-4bc52a79] {
		width: 70.5%;
	}
	
	.other-info-edu {
		margin-left: 11px;
	}
	
	.other-info-edu .ivu-form-item-content .ivu-select {
		width: 63%;
		margin-left: 11px;
	}
	
	.other-info-computer {
		margin-left: 22px !important;
	}
	
	.other-info-computer .ivu-form-item-content .ivu-select {
		width: 65.5%;
		margin-left: 11px;
	}
	
	.other-info-comptime {
		margin-left: 23px;
	}
	
	.other-info-comptime .ivu-form-item-content .ivu-select {
		width: 68%;
	}
	
	.other-info-major {
		margin-left: 58px;
	}
	
	.other-info-major .ivu-form-item-content .ivu-select {
		width: 73%;
		margin-left: 11px;
	}
	
	.other-info-sort {
		margin-left: 58px;
	}
	
	.other-info-sort .ivu-form-item-content .ivu-select {
		width: 76.5%;
	}
	
	.other-info-sortinput {
		width: 72%;
		margin-left: 11px;
	}
</style>

<template>
	<div class="user-context">
		<div class="user-condition">
			<div class="first-row">
				<span>{{userPageLebal[0].fcn}}：</span>
				<Select placeholder="请选择" class="user-dep" v-model="SdepNo">
					<Option value="01">北京市</Option>
					<Option value="02">上海市</Option>
					<Option value="shenzhen">深圳市</Option>
				</Select>
				<span style="margin-left: 25px;">{{userPageLebal[3].fcn}}：</span>
				<Date-picker type="date" placeholder="选择日期" style="width: 259px" v-model="SarmyTime"></Date-picker>
				<span>{{soliderAge}}{{userPageLebal[4].fcn}}</span>
				<span style="margin-left: 25px;">{{userPageLebal[2].fcn}}：</span>
				<Input class="user-dep" v-model="Sname"></Input>
				<span style="margin-left: 25px;">{{userPageLebal[5].fcn}}：</span>
				<Select placeholder="请选择" class="user-dep" v-model="Srank">
					<Option value="beijing">北京市</Option>
					<Option value="shanghai">上海市</Option>
					<Option value="shenzhen">深圳市</Option>
				</Select>
				<span><img src="../../common/images/401.gif"  height="20px" width="50px"/></span>
			</div>

			<div class="second-row">
				<span>{{userPageLebal[6].fcn}}：</span>
				<Select placeholder="请选择" class="user-dep" v-model="Sjob">
					<Option value="beijing">北京市</Option>
					<Option value="shanghai">上海市</Option>
					<Option value="shenzhen">深圳市</Option>
				</Select>
				<span style="margin-left: 25px;">{{userPageLebal[7].fcn}}：</span>
				<Select placeholder="请选择" class="user-dep" v-model="Sstatue">
					<Option value="1">在位</Option>
					<Option value="2">不在位</Option>
					<Option value="3">外出</Option>
				</Select>
				<div class="btn-grop">
					<Button type="primary" @click="getUserBy">查询</Button>
					<Button type="primary" @click="_userAdd">新增</Button>
					<Button type="error" @click="deleteUser">删除</Button>
				</div>
			</div>

		</div>
		<div class="user-table">
			<Table border :columns="userDataColumn" :data="userData" @on-selection-change="getUserId" @on-select-all='getUserIds'></Table>
		</div>
		<div class="user-page">
			<Page :total="total"   @on-change="changePage" @on-page-size-change="changePageSize" :page-size="pageSize"  show-total></Page>
		</div>
		<!--user add-->
		<Modal v-model="userAddModal" width="800" :mask-closable="false">
			<p slot="header">
				<span>{{userModalLebal[0].fcn}}</span>
			</p>
			<div>
				<Form :model="userItem" :label-width="87" class="addUser">
					<Row>
						<Col span="12">
						<div class="user-dep-span">
							<span>{{userModalLebal[1].fcn}}</span>
							<Input v-model="Mname" placeholder="请输入" style="width: 76%;" class="input" @on-blur="getUserName"></Input>
						</div>
						<div class="user-dep-style">
							<span>{{userModalLebal[2].fcn}}</span>
							<Input v-model="Mdep" placeholder="请输入" style="width:76%;" class="input"></Input>
						</div>
						</Col>
						<Col span="12" class="user-pic">
						<div class="demo-upload-list" v-for="item in uploadList">
							<template v-if="item.status === 'finished'">
								<img :src="item.url">
								<div class="demo-upload-list-cover">
									<Icon type="ios-eye-outline" @click.native="handleView(item.name)"></Icon>
									<Icon type="ios-trash-outline" @click.native="handleRemove(item)"></Icon>
								</div>
							</template>
							<template v-else>
								<Progress v-if="item.showProgress" :percent="item.percentage" hide-info></Progress>
							</template>
						</div>
						<Upload ref="upload" :show-upload-list="false" :default-file-list="defaultList" :on-success="handleSuccess" :format="['jpg','jpeg','png']" :max-size="2048" :on-format-error="handleFormatError" :on-exceeded-size="handleMaxSize" :before-upload="handleBeforeUpload" multiple type="drag" :action="pic" style="display: inline-block;width:58px;">
							<div style="width: 58px;height:58px;line-height: 58px;">
								<Icon type="camera" size="20"></Icon>
							</div>
						</Upload>
						</Col>
						<Col span="12">
						<Form-item :label="userModalLebal[3].fcn">
							<Date-picker type="date" placeholder="选择日期" style="width: 300px" v-model="MarmyTime"></Date-picker>
						</Form-item>
						</Col>
						<Col span="12">
						<Form-item :label="userModalLebal[4].fcn">
							<Radio-group v-model="MuserType">
								<Radio :label="userModalLebal[5].fcn"></Radio>
								<Radio :label="userModalLebal[6].fcn"></Radio>
							</Radio-group>
						</Form-item>
						</Col>
						<Col span="12">
						<Form-item :label="userModalLebal[7].fcn">
							<Radio-group v-model="MuserSex">
								<Radio :label="userModalLebal[8].fcn"></Radio>
								<Radio :label="userModalLebal[9].fcn"></Radio>
							</Radio-group>
						</Form-item>
						</Col>
						<Col span="12">
						<Form-item :label="userModalLebal[10].fcn">
							<Select placeholder="请选择" v-model="Mnation">
								<Option value="beijing">北京市</Option>
								<Option value="shanghai">上海市</Option>
								<Option value="shenzhen">深圳市</Option>
							</Select>
						</Form-item>
						</Col>
						<Col span="12">
						<Form-item :label="userModalLebal[11].fcn">
							<Select placeholder="请选择" v-model="MnativePlace">
								<Option value="beijing">北京市</Option>
								<Option value="shanghai">上海市</Option>
								<Option value="shenzhen">深圳市</Option>
							</Select>
						</Form-item>
						</Col>
						<Col span="12">
						<Form-item :label="userModalLebal[12].fcn">
							<Input v-model="MidCard"></Input>
						</Form-item>
						</Col>
						<Col span="12">
						<Form-item :label="userModalLebal[13].fcn">
							<Select placeholder="请选择" v-model="Mstate">
								<Option value="beijing">北京市</Option>
								<Option value="shanghai">上海市</Option>
								<Option value="shenzhen">深圳市</Option>
							</Select>
						</Form-item>
						</Col>
						<Col span="24">
						<span style="font-weight: 900;">{{userModalLebal[14].fcn}}</span>
						</Col>

						<Col span="12">
						<Form-item :label="userModalLebal[15].fcn">
							<Input placeholder="请输入" disabled v-model="MuserName"></Input>
						</Form-item>
						</Col>
						<Col span="12">
						<span style="color: red;margin-left: 35px;">{{userModalLebal[16].fcn}}</span>
						</Col>

					</Row>
					<Collapse>
						<Panel name="1">
							{{userModalLebal[17].fcn}}
							<p slot="content">
								<Row>
									<Col span="12">
									<Form-item :label="userModalLebal[18].fcn">
										<Select placeholder="请选择" v-model="MuserHost">
											<Option value="beijing">农村</Option>
											<Option value="shanghai">非农村</Option>
										</Select>
									</Form-item>
									</Col>
									<Col span="12">
									<Form-item :label="userModalLebal[19].fcn">
										<Select placeholder="请选择" v-model="MuserIsMarray">
											<Option value="beijing">已婚</Option>
											<Option value="shanghai">未婚</Option>
										</Select>
									</Form-item>
									</Col>
									<Col span="12">
									<Form-item :label="userModalLebal[20].fcn">
										<Date-picker type="date" placeholder="选择日期" style="width: 281px" v-model="MuserjoinSchoolTime"></Date-picker>
									</Form-item>
									</Col>
									<Col span="12">
									<Form-item :label="userModalLebal[21].fcn">
										<Date-picker type="date" placeholder="选择日期" style="width: 281px" v-model="MuserLeaveSchoolTime"></Date-picker>
									</Form-item>
									</Col>
									<Col span="12">
									<Form-item :label="userModalLebal[22].fcn">
										<Select placeholder="请选择" v-model="MuserLeaveSchool">
											<Option value="beijing">北京市</Option>
											<Option value="shanghai">上海市</Option>
											<Option value="shenzhen">深圳市</Option>
										</Select>
									</Form-item>
									</Col>
									<Col span="12">
									<Form-item :label="userModalLebal[23].fcn">
										<Select placeholder="请选择" v-model="MuserMajor">
											<Option value="beijing">北京市</Option>
											<Option value="shanghai">上海市</Option>
											<Option value="shenzhen">深圳市</Option>
										</Select>
									</Form-item>
									</Col>
									<Col span="12">
									<Form-item :label="userModalLebal[24].fcn">
										<Select placeholder="请选择" v-model="MuserEdu">
											<Option value="beijing">北京市</Option>
											<Option value="shanghai">上海市</Option>
											<Option value="shenzhen">深圳市</Option>
										</Select>
									</Form-item>
									</Col>
									<Col span="12">
									<Form-item :label="userModalLebal[25].fcn">
										<Input v-model="MuserAddress"></Input>
									</Form-item>
									</Col>
									<Col span="12">
									<Form-item :label="userModalLebal[26].fcn">
										<Select placeholder="请选择" v-model="MuserJob">
											<Option value="beijing">北京市</Option>
											<Option value="shanghai">上海市</Option>
											<Option value="shenzhen">深圳市</Option>
										</Select>
									</Form-item>
									</Col>
									<Col span="12">
									<Form-item :label="userModalLebal[27].fcn">
										<Select placeholder="请选择" v-model="MuserNowRank">
											<Option value="beijing">北京市</Option>
											<Option value="shanghai">上海市</Option>
											<Option value="shenzhen">深圳市</Option>
										</Select>
									</Form-item>
									</Col>
									<Col span="12">
									<Form-item :label="userModalLebal[28].fcn">
										<Select placeholder="请选择" class="user-military-rank" v-model="MuserMilitaryRank">
											<Option value="beijing">北京市</Option>
											<Option value="shanghai">上海市</Option>
											<Option value="shenzhen">深圳市</Option>
										</Select>
										<img src="../../common/images/401.gif" height="20" width="50" style="margin-top: 5px;">
									</Form-item>
									</Col>
									<Col span="12">
									<Form-item :label="userModalLebal[29].fcn">
										<Date-picker type="date" placeholder="选择日期" style="width: 281px" v-model="MuserMilitaryRankTime"></Date-picker>
									</Form-item>
									</Col>
									<Col span="12">
									<Form-item :label="userModalLebal[30].fcn">
										<Select placeholder="请选择" v-model="MuserMilitaryWenJi">
											<Option value="beijing">北京市</Option>
											<Option value="shanghai">上海市</Option>
											<Option value="shenzhen">深圳市</Option>
										</Select>
									</Form-item>
									</Col>
									<Col span="12">
									<Form-item :label="userModalLebal[31].fcn">
										<Select placeholder="请选择" v-model="MuserSource">
											<Option value="beijing">北京市</Option>
											<Option value="shanghai">上海市</Option>
											<Option value="shenzhen">深圳市</Option>
										</Select>
									</Form-item>
									</Col>
									<Col span="12">
									<Form-item :label="userModalLebal[32].fcn">
										<Date-picker type="date" placeholder="选择日期" style="width: 281px" v-model="MuserOrgan"></Date-picker>
									</Form-item>
									</Col>
									<Col span="12">
									<Form-item :label="userModalLebal[33].fcn">
										<Date-picker type="date" placeholder="选择日期" style="width: 281px" v-model="MuserRankTime"></Date-picker>
									</Form-item>
									</Col>
									<Col span="12">
									<Form-item :label="userModalLebal[34].fcn">
										<!--<i-switch size="large" v-model="MuserType"  :disabled="disabled">
											<span slot="open">军官</span>
											<span slot="close">士兵</span>
										</i-switch>-->
										<Input class="user-card-number" v-model="MuserCardNum">
										</Input>
									</Form-item>
									</Col>
									<Col span="12">
									<Form-item :label="userModalLebal[35].fcn">
										<i-switch size="large" v-model="MuserIsManager">
											<span slot="open">是</span>
											<span slot="close">否</span>
										</i-switch>
									</Form-item>
									</Col>
								</Row>
							</p>
						</Panel>
						<Panel name="2">
							{{userModalLebal[36].fcn}}
							<p slot="content" class="other-info">
								<Row>
									<Form ref="formDynamic" :model="formDynamic">
										<Form-item v-for="(item, index) in formDynamic.items" :key="index" :prop="'items.' + index + '.value'" :rules="{required: true}">
											<Row>
												<Col span="12">
												<Form-item :label="userModalLebal[37].fcn">
													<Select placeholder="请选择" class="job-check" v-model="MjobSkill">
														<Option value="beijing">北京市</Option>
														<Option value="shanghai">上海市</Option>
														<Option value="shenzhen">深圳市</Option>
													</Select>
												</Form-item>
												</Col>
												<Col span="12">
												<Form-item :label="userModalLebal[38].fcn">
													<Date-picker type="date" placeholder="选择日期" style="width: 220px" v-model="MjobSkillTime"></Date-picker>
												</Form-item>
												</Col>
											</Row>
										</Form-item>
										<Form-item>
											<Row>
												<Col span="24" class="job-check-add">
												<Button type="dashed" long @click="handleAdd" icon="plus-round">新增</Button>
												</Col>
											</Row>
										</Form-item>
										<Row>
											<Col span="12">
											<Form-item :label="userModalLebal[39].fcn" class="other-info-labal">
												<Select placeholder="请选择" v-model="MuserEduUp">
													<Option value="beijing">北京市</Option>
													<Option value="shanghai">上海市</Option>
													<Option value="shenzhen">深圳市</Option>
												</Select>
											</Form-item>
											</Col>
											<Col span="12">
											<Form-item :label="userModalLebal[40].fcn" class="other-info-labal">
												<Date-picker type="date" placeholder="选择日期" style="width: 220px;margin-left: 11px;" v-model="MuserEduUpTime"></Date-picker>
											</Form-item>
											</Col>
											<Col span="12">
											<Form-item :label="userModalLebal[41].fcn" class="other-info-edu">
												<Select placeholder="请选择" v-model="MuserComputerUp">
													<Option value="beijing">北京市</Option>
													<Option value="shanghai">上海市</Option>
													<Option value="shenzhen">深圳市</Option>
												</Select>
											</Form-item>
											</Col>
											<Col span="12">
											<Form-item :label="userModalLebal[42].fcn" class="other-info-labal">
												<Date-picker type="date" placeholder="选择日期" style="width: 220px;margin-left: 11px;" v-model="MuserComputerUpTime"></Date-picker>
											</Form-item>
											</Col>
											<Col span="12">
											<Form-item :label="userModalLebal[43].fcn" class="other-info-computer">
												<Select placeholder="请选择" v-model="MuserSpeciality">
													<Option value="beijing">北京市</Option>
													<Option value="shanghai">上海市</Option>
													<Option value="shenzhen">深圳市</Option>
												</Select>
											</Form-item>
											</Col>
											<Col span="12">

											</Col>
											<Col span="12">
											<Form-item :label="userModalLebal[44].fcn" class="other-info-sort">
												<Input class="other-info-sortinput" v-model="MuserSort"></Input>
											</Form-item>
											</Col>
										</Row>

									</Form>

								</Row>
							</p>
						</Panel>

					</Collapse>
				</Form>
			</div>
			<div slot="footer">
				<Button type="primary" @click="_cancel">取消</Button>
				<Button type="primary" @click="addUserInfo">确定</Button>
			</div>
		</Modal>
		<Modal title="查看图片" v-model="visible" :mask-closable="false">
			<img :src="showPic" v-if="visible" style="width: 100%">
		</Modal>
	</div>
</template>
<script>
	export default {
		data() {
			return {
				//search
				SdepNo: null,
				SarmyTime: null,
				Sname: null,
				Srank: null,
				Sjob: null,
				Sstatue: null,

				showPic: '',
				userId: [],
				disabled: true, //军官还是士兵
				thisPage: 1,
				pageSize: 10,
				total: 0,
				//userPageLebal
				userPageLebal: [{
					fcn: '单位'
				}, {
					fcn: '人员类型'
				}, {
					fcn: '姓名'
				}, {
					fcn: '入伍年月'
				}, {
					fcn: '年兵龄'
				}, {
					fcn: '军衔'
				}, {
					fcn: '职务'
				}, {
					fcn: '状态'
				}],
				//userModalLebal
				userModalLebal: [{
					fcn: '新增人员'
				}, {
					fcn: '姓名'
				}, {
					fcn: '单位'
				}, {
					fcn: '入伍时间'
				}, {
					fcn: '人员类型'
				}, {
					fcn: '军官'
				}, {
					fcn: '战士'
				}, {
					fcn: '性别'
				}, {
					fcn: '男'
				}, {
					fcn: '女'
				}, {
					fcn: '名族'
				}, {
					fcn: '籍贯'
				}, {
					fcn: '身份证号'
				}, {
					fcn: '状态'
				}, {
					fcn: '人员关联用户'
				}, {
					fcn: '登录名'
				}, {
					fcn: '注意：使用登录名登录系统，初始密码是123456'
				}, {
					fcn: '详细信息'
				}, {
					fcn: '户口'
				}, {
					fcn: '婚否'
				}, {
					fcn: '入校时间'
				}, {
					fcn: '毕业时间'
				}, {
					fcn: '毕业院校'
				}, {
					fcn: '专业'
				}, {
					fcn: '文化程度'
				}, {
					fcn: '家庭住址'
				}, {
					fcn: '职务'
				}, {
					fcn: '现职级'
				}, {
					fcn: '军衔'
				}, {
					fcn: '军衔时间'
				}, {
					fcn: '军衔文级'
				}, {
					fcn: '来源'
				}, {
					fcn: '党团时间'
				}, {
					fcn: '现级时间'
				}, {
					fcn: '证件号'
				}, {
					fcn: '是否主官'
				}, {
					fcn: '其他信息'
				}, {
					fcn: '职业技能鉴定：'
				}, {
					fcn: '职业技能鉴定时间：'
				}, {
					fcn: '学历升级'
				}, {
					fcn: '学历升级时间'
				}, {
					fcn: '计算机过级'
				}, {
					fcn: '计算机过级时间'
				}, {
					fcn: '专长'
				}, {
					fcn: '显示顺序'
				}, {
					fcn: '现职级'
				}],
				formDynamic: {
					items: [{
						value: ''
					}]
				},
				userHost: "城市",
				userMarray: "已婚",
				//upload
				defaultList: [],
				imgName: '',
				visible: false,
				uploadList: [],
				userItem: {
					name: '',
				},
				//user add modal
				userAddModal: false,
				soliderAge: 1,
				userDataColumn: [{
						type: 'selection',
						width: 60,
						align: 'center'
					},
					{
						title: '序号',
						type: 'index',
						width: 80,
						align: 'center',
					}, {
						title: '姓名',
						key: 'fname'
					}, {
						title: '单位',
						key: 'fdeptno'
					}, {
						title: '职务',
						key: 'fjob'
					}, {
						title: '现职级',
						key: 'fnowrank'
					},
					{
						title: '职级时间',
						key: 'franktime'
					},
					{
						title: '军衔',
						key: 'fmilitaryrank'
					},
					{
						title: '名族',
						key: 'fnation'
					},
					{
						title: '政治面貌',
						key: 'fpolitic'
					},
					{
						title: '入伍年月',
						key: 'farmytime',
						sortable: true
					},
					{
						title: '操作',
						key: 'action',
						width: 150,
						align: 'center',
						render: (h, params) => {
							return h('div', [
								h('Button', {
									props: {
										type: 'primary',
										size: 'small'
									},
									style: {
										marginRight: '5px'
									},
									on: {
										click: () => {
											this.editUser(params)
										}
									}
								}, '编辑'),
							]);
						}
					}

				],
				//表格数据
				userData: [],
				//模态框值 Mxx
				Mname: '',
				Mdep: '',
				MarmyTime: '',
				MuserType: '军官',
				MuserSex: '男',
				Mnation: '',
				MnativePlace: '',
				MidCard: '',
				Mstate: '',
				MuserName: '',
				MjobSkill: '',
				MjobSkillTime: '',
				MuserHost: '',
				MuserIsMarray: '',
				MuserjoinSchoolTime: '',
				MuserLeaveSchool: '',
				MuserLeaveSchoolTime: '',
				MuserMajor: '',
				MuserEdu: '',
				MuserAddress: '',
				MuserJob: '',
				MuserNowRank: '',
				MuserMilitaryRank: '',
				MuserMilitaryRankTime: '',
				MuserMilitaryWenJi: '',
				MuserSource: '',
				MuserOrgan: '',
				MuserCardType: '',
				MuserCardNum: '',
				MuserIsManager: '',
				MuserEduUp: '',
				MuserEduUpTime: '',
				MuserComputerUp: '',
				MuserComputerUpTime: '',
				MuserSpeciality: '',
				MuserSort: '',
				MuserRankTime: '',
			}
		},
		methods: {
			//新增
			_userAdd() {
				this.userAddModal = true;
			},
			//取消
			_cancel() {
				console.info("_cancel")
			},
			//确定
			_ok() {
				console.info("_ok")
			},
			handleView(name) {
				this.imgName = name;
				this.visible = true;
			},
			handleRemove(file) {
				// 从 upload 实例删除数据
				const fileList = this.$refs.upload.fileList;
				this.$refs.upload.fileList.splice(fileList.indexOf(file), 1);
			},
			handleSuccess(res, file) {
				// 因为上传过程为实例，这里模拟添加 url
				console.log(res)
				file.url = this.url + res.obj;
				console.log(file)
				file.url = this.picurl + res.obj;
				this.showPic = this.picurl + res.obj

			},
			handleFormatError(file) {
				this.$Notice.warning({
					title: '文件格式不正确',
					desc: '文件 ' + file.name + ' 格式不正确，请上传 jpg 或 png 格式的图片。'
				});
			},
			handleMaxSize(file) {
				this.$Notice.warning({
					title: '超出文件大小限制',
					desc: '文件 ' + file.name + ' 太大，不能超过 2M。'
				});
			},
			handleBeforeUpload() {
				const check = this.uploadList.length < 1;
				if(!check) {
					this.$Notice.warning({
						title: '最多只能上传 1 张图片。'
					});
				}
				return check;
			},
			handleAdd() {
				console.info(this.formDynamic)
				this.formDynamic.items.push({
					value: ''
				});
			},
			//根据条件查询人员
			getUserBy() {
				if(this.SarmyTime==''){
					this.SarmyTime=null
				}
				if(this.SdepNo==''){
					this.SdepNo=null
				}
				if(this.Sjob==''){
					this.Sjob=null
				}
				if(this.Srank==''){
					this.Srank=null
				}
				if(this.Sname==''){
					this.Sname=null
				}
				let param = {
					farmytime: this.SarmyTime,
					fdeptno: this.SdepNo,
					fjob: this.Sjob,
					fmilitaryrank: this.Srank,
					fname: this.Sname,
					fstate: this.Sstatue,
					pageCurrent: this.thisPage,
					pageSize: this.pageSize

				}
				this.$http.post(this.url + '/person/select', param).then(response => {
					let isOk = response.data;
					//console.info(isOk.obj)
					if(isOk.success) {
						if(isOk.obj == null) {
							this.total = this.total;
							this.userData = [];
						} else {
							this.total = isOk.obj.itemTotal;
							this.userData = isOk.obj.items;
						}
					} else {
						this.$Message.error(isOk.msg);
					}
				}, response => {});
			},
			getUserName() {
				this.$http.get(this.url + 'person/createName/' + this.Mname).then(response => {
					let isOk = response.data;
					//console.info(isOk.obj)
					if(isOk.success) {
						this.MuserName = isOk.obj;
					} else {
						this.$Message.error(isOk.msg);
					}

				}, response => {

				});

			},
			addUserInfo() {
				console.info(1)
				let param = {
					basSkillJudgeList: [],
					person: {
						fdeptno: this.Mdep,
						fname: this.Mname,
						farmytime: this.MarmyTime,
						fspeciality: this.MuserSpeciality,
						fsort: this.MuserSort,
						fmilitaryrank: this.MuserRank,
						ffamilyhold: this.MuserHost,
						fmarriage: this.MuserIsMarray,
						finschooltime: this.MuserjoinSchoolTime,
						foutschooltime: this.MuserLeaveSchoolTime,
						fcollege: this.MuserLeaveSchool,
						fmajor: this.MuserMajor,
						feducationrank: this.MuserEdu,
						faddress: this.MuserAddress,
						fjob: this.MuserJob,
						fnowrank: this.MuserNowRank,
						fmilitaryrank: this.MuserMilitaryRank,
						fmilitaryranktime: this.MuserMilitaryRankTime,
						franklevel: this.MuserMilitaryWenJi,
						fsource: this.MuserSource,
						fcaucustime: this.MuserOrgan,
						franktime: this.MuserRankTime,
						fidnumber: this.MuserCardNum,
						fischarge: this.MuserIsManager,
					},
					username: this.MuserName
				}
				this.$http.post(this.url + 'person/insert', param).then(response => {
					let isOk = response.data;
					//console.info(isOk.obj)
					if(isOk.success) {
						console.log("-------12------")
						console.log(isOk.obj)
						this.userAddModal = false;
						console.log("-------------")
					} else {
						this.$Message.error(isOk.msg);
					}
				}, response => {});

			},
			editUser(data) {
				this.userAddModal = true;
				this.userModalLebal[0].fcn = "修改人员"
				let obj = data.row;

				this.Mdep = obj.fdeptno;
				this.Mname = obj.fname;
				this.MarmyTime = obj.farmytime;
				this.MuserSpeciality = obj.fspeciality;
				this.MuserSort = obj.fsort;
				this.MuserRank = obj.fmilitaryrank;
				this.MuserHost = obj.ffamilyhold;
				this.MuserIsMarray = obj.fmarriage;
				this.MuserjoinSchoolTime = obj.finschooltime;
				this.MuserLeaveSchoolTime = obj.foutschooltime;
				this.MuserLeaveSchool = obj.fcollege;
				this.MuserMajor = obj.fmajor;
				this.MuserEdu = obj.feducationrank;
				this.MuserAddress = obj.faddress;
				this.MuserJob = obj.fjob;
				this.MuserNowRank = obj.fnowrank;
				this.MuserMilitaryRank = obj.fmilitaryrank;
				this.MuserMilitaryRankTime = obj.fmilitaryranktime;
				this.MuserMilitaryWenJi = obj.franklevel;
				this.MuserSource = obj.fsource;
				this.MuserOrgan = obj.fcaucustime;
				this.MuserRankTime = obj.franktime;
				this.MuserCardNum = obj.fidnumber;
				this.MuserIsManager = obj.fischarge;
			},
			addEditUser() {
				if(this.userModalLebal[0].fcn == "修改人员") {
					console.info(12)
				}
			},
			getUserId(select) {
				this.userId = select;
			},
			getUserIds(select) {
				this.userId = select;
			},
			//删除用户

			deleteUser() {
				let fno = [];
				for(var i = 0; i < this.userId.length; i++) {
					fno.push(this.userId[i].fno)
				}
				this.$http.post(this.url + 'person/delete', fno).then(response => {
					let isOk = response.data;
					if(isOk.success) {
						console.log("------4545------")
						console.log(isOk.obj)
						this.getUserBy();
						console.log("-------------")
					} else {
						this.$Message.error(isOk.msg);
					}
				}, response => {});
			},
			
			//分页
			changePage(page){
				this.thisPage = page;
				this.getUserBy();
			},

			//改变表格显示大小的时候
			changePageSize(pageSize){
				this.pageSize = pageSize;
					this.getUserBy();
			},
			//条件查询
			//			search() {
			//				
			//				this.$http.post(this.url + 'person/select', param).then(response => {
			//					let isOk = response.data;
			//					if(isOk.success) {
			//					this.total=isOk.obj.temTotal;
			//					this.userData=isOk.obj.items;
			//					} else {
			//						this.$Message.error(isOk.msg);
			//					}
			//				}, response => {});
			//
			//			}

		},
		mounted() {
			this.uploadList = this.$refs.upload.fileList;
			this.getUserBy();
		}

	}
</script>